Skip to content

Use Turkish numeric separators - #465

Open
emrehangorgec wants to merge 1 commit into
python-humanize:mainfrom
emrehangorgec:fix/turkish-number-separators
Open

emrehangorgec wants to merge 1 commit into
python-humanize:mainfrom
emrehangorgec:fix/turkish-number-separators

Conversation

@emrehangorgec

Copy link
Copy Markdown

Activating tr_TR translates words but leaves English numeric separators. intcomma(1_234_567.89) returns 1,234,567.89, and the Turkish string "1234567,89" is read as 123,456,789.

Changes proposed in this pull request:

  • Register tr_TR with a dot for grouping and a comma for decimals, following Unicode CLDR.
  • Extend the existing intcomma and intword locale tests, and add a README example.

Found through code inspection and reproduced locally. Three regression checks fail before the fix. No matching issue or PR was found.

Validation on Windows with Python 3.14:

  • python -m pytest tests src/humanize --doctest-modules --benchmark-disable --cov=humanize: 873 passed, 99% coverage.
  • python -m mypy .: passed for all 14 source files.
  • prek run --all-files --show-diff-on-failure: passed.
  • The README example passed all four doctest checks. git diff --check passed.

Translation catalogs were compiled before testing. Local hook setup required reinstalling validate-pyproject==0.26 to restore missing schema files. Benchmark timings and other platforms were not tested.

Does this handle Turkish numeric inputs as intended, including strings passed to intcomma?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant